package com.mall.items.web.pojo;

import com.mall.manager.pojo.TbItem;
import lombok.Data;

/**
 * 在之前的item中派生该类，然后自己使用该pojo,防止其他项目变动这里出现毁灭性改变，这里只是添加了一个方法
 */

public class Item extends TbItem {

    public Item(){
        super();
    }

    public Item(TbItem tbItem){
        this.setId(tbItem.getId());
        this.setTitle(tbItem.getTitle());
        this.setSellPoint(tbItem.getSellPoint());
        this.setPrice(tbItem.getPrice());
        this.setNum(tbItem.getNum());
        this.setBarcode(tbItem.getBarcode());
        this.setImage(tbItem.getImage());
        this.setCid(tbItem.getCid());
        this.setStatus(tbItem.getStatus());
        this.setCreated(tbItem.getCreated());
        this.setUpdated(tbItem.getUpdated());
    }

    @Override
    public String [] getImages(){
        String image = this.getImage();
        String[] images = image.split(",");
        return images;
    };

}
